package versi.vitro.oaiserviceprovider.service.handle.impl;

import versi.vitro.oaiserviceprovider.test.BaseTestCase;

public class HandleServiceIntegrationTest extends BaseTestCase {

	/*private final String newModelName = "testNewModel";
	
	@DataProvider(name = "incorrectParametersForUnsuccessfulLogin")
	public Object[][] incorrectParametersForUnsuccessfulLogin()
	{
		return new Object[][] {
		// without host
		        { null, JENA_DATABASE, JENA_USER, JENA_PASS },
		        // without user name
		        { JENA_HOST, JENA_DATABASE, null, JENA_PASS },
		        // without password
		        { JENA_HOST, JENA_DATABASE, JENA_USER, null },
		        // wrong user-password matching
		        { JENA_HOST, JENA_DATABASE, JENA_USER + "wrong", JENA_PASS + "wrong" },
		        // wrong host
		        { "wrong" + JENA_HOST, JENA_DATABASE, JENA_USER, JENA_PASS },
		        // wrong database
		        { JENA_HOST, "wrong"+JENA_DATABASE , JENA_USER, JENA_PASS } };
	}
	
	
	JenaConnManager jenaConnManager;
	
	@Test
	public void runTests() throws Exception
	{
		testLoginJenaOperation();
		testModelMakerOperation();
		testCreateModelOperation();
		testClearModelOperation();
		testDeleteModelOperation();
		
		
	}
		
	private void testLoginJenaOperation() throws Exception
	{
		jenaConnManager = getJenaConnManager();
		
		jenaConnManager.setJenaDBurl("jdbc:mysql://"+ JENA_HOST +":"+ 3306 +"/"+JENA_DATABASE);
		
		jenaConnManager.setUsername(JENA_USER);
		
		jenaConnManager.setPassword(JENA_PASS);
		
		jenaConnManager.connect();
			
		
	}
	
	@Test(expectedExceptions = { Exception.class }, dataProvider = "incorrectParametersForUnsuccessfulLogin")
	public void testUnsuccessfulLoginWithWrongParameters(String host, String database, String user, String password) throws Exception
	{
		jenaConnManager = getJenaConnManager();
		
		jenaConnManager.setJenaDBurl("jdbc:mysql://"+ JENA_HOST +":"+ 3306 +"/"+JENA_DATABASE);
		
		jenaConnManager.setUsername(JENA_USER);
		
		jenaConnManager.setPassword(JENA_PASS);
		
		jenaConnManager.connect();
		
		
	}
	

	private void testModelMakerOperation() throws Exception
	{
		ModelMaker modelMaker = getJenaConnManager().getModelMaker();
		
		assert null != modelMaker;
		
		getJenaService().setModelMaker(modelMaker);
		
	}
	
	private void testCreateModelOperation() throws Exception
	{
		getJenaService().createModel(newModelName);
		assert null != getJenaService().getModel(newModelName);
	}
	
	private void testClearModelOperation() throws Exception
	{
		getJenaService().clearModel(newModelName);
		assert 0 == getJenaService().getModel(newModelName).size();
	}
	
	private void testDeleteModelOperation() throws Exception
	{
		getJenaService().deleteModel(newModelName);
		
	}
	*/
	
	
	
}
